/**
 * 路由路径配置
 */

// 引入路由组件
import Home from '@/views/home'
import Cart from '@/views/cart'
import Detail from '@/views/detail'
import Mine from '@/views/mine'
import Category from '@/views/category'
import Login from '@/views/login'

// 引入头部和尾部插件
import NavBar from '@/components/nav-bar'
import TabBar from '@/components/tab-bar'

// 定义路径数组
const routes = [
  {
    path: '/',
    redirect: 'home',
    meta: {
      title: '首页',
    },
  },
  {
    path: '/home',
    components: {
      header: NavBar,
      default: Home,
      footer: TabBar,
    },
    meta: {
      title: '首页',
    },
  },
  {
    path: '/category',
    components: {
      header: NavBar,
      default: Category,
      footer: TabBar,
    },
    meta: {
      title: '分类',
    },
  },
  {
    path: '/cart',
    components: {
      header: NavBar,
      default: Cart,
      footer: TabBar,
    },
    meta: {
      title: '购物车',
    },
  },
  {
    path: '/mine',
    components: {
      header: NavBar,
      default: Mine,
      footer: TabBar,
    },
    meta: {
      title: '我的',
    },

  },
  {
    path: '/detail',
    components: {
      header: NavBar,
      default: Detail,
    },
    meta: {
      title: '商品详情',
    },
  },
  {
    path: '/login',
    components: {
      header: NavBar,
      default: Login,
      footer: TabBar,
    },
    meta: {
      title: '登录',
    },
  },
]

// 导出数组
export default routes
